package com.yoj.questionservice.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yoj.model.dto.questionsubmit.QuestionSubmitAddRequest;
import com.yoj.model.dto.questionsubmit.QuestionSubmitQueryRequest;
import com.yoj.model.entity.QuestionSubmit;
import com.yoj.model.entity.User;
import com.yoj.model.vo.QuestionSubmitVO;

import javax.servlet.http.HttpServletRequest;

/**
 * @author admin
 * @description 针对表【question_submit(题目提交表)】的数据库操作Service
 * @createDate 2024-06-29 15:46:59
 */
public interface QuestionSubmitService extends IService<QuestionSubmit> {

    /**
     * 题目提交
     */
    long doQuestionSubmit(QuestionSubmitAddRequest questionSubmitAddRequest, User loginUser);

    /**
     * 获取题目提交查询类
     */
    QueryWrapper<QuestionSubmit> getQueryWrapper(QuestionSubmitQueryRequest questionSubmitQueryRequest);

    /**
     * 获取题目封装
     */
    QuestionSubmitVO getQuestionSubmitVO(QuestionSubmit questionSubmit, User loginUser);

    /**
     * 分页查询题目提交视图
     */
    Page<QuestionSubmitVO> getQuestionSubmitVOPage(Page<QuestionSubmit> questionSubmitPage, User loginUser);

    /**
     * 分页查询题目提交视图
     */
    Page<QuestionSubmitVO> getQuestionSubmitVOPage(QuestionSubmitQueryRequest questionSubmitQueryRequest, HttpServletRequest request);

    /**
     * 用户查询自己的题目提交信息
     */
    Page<QuestionSubmitVO> getUserQuestionSubmitVOPage(QuestionSubmitQueryRequest questionSubmitQueryRequest, HttpServletRequest request);

    /**
     * 根据题目提交 id 查询判题结果
     */
    QuestionSubmitVO getQuestionSubmitVO(Long id, HttpServletRequest request);

}